package com.fance.model;

import org.springframework.stereotype.Component;

/**
 * @author fance
 * @date 18-5-5 上午11:41
 */
@Component
public class HostHolder {
    private static ThreadLocal<User> userThreadLocal = new ThreadLocal<>();

    public User getUser() {
        return userThreadLocal.get();
    }
    public void setUser(User user) {
         userThreadLocal.set(user);
    }

    public void clear() {
        userThreadLocal.remove();
    }

}
